import request from '@/utils/request'

// 获取公司组织架构扁平数据接口
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 获取员工简单列表
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
// 增加新部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 增加新部门
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 根据ID修改部门详情
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
// 根据ID修改部门详情
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
